<template>
  <div>
    <Dog3
      v-for="(item, index) in arr"
      :key="index"
      :dogurl="item.dogImgUrl"
      :name="item.dogName"
      @love="fn"
    />
    <hr />
    <p>喜欢的狗狗</p>
    <ul>
      <li v-for="(item,index) in lovearr" :key="index">{{item}}</li>
      <!-- <li v-for="(item, index) in loveArr" :key="index">{{ item }}</li> -->
    </ul>
  </div>
</template>

<script>
import Dog3 from "./components/Dog3";
export default {
  components: {
    Dog3,
  },
  data() {
    return {
      lovearr: [],
      arr: [
        {
          dogImgUrl:
            "http://nwzimg.wezhan.cn/contents/sitefiles2029/10146688/images/21129958.jpg",
          dogName: "博美",
        },
        {
          dogImgUrl:
            "http://nwzimg.wezhan.cn/contents/sitefiles2029/10146688/images/21129958.jpg",
          dogName: "泰迪",
        },
        {
          dogImgUrl:
            "http://nwzimg.wezhan.cn/contents/sitefiles2029/10146688/images/21129958.jpg",
          dogName: "金毛",
        },
        {
          dogImgUrl:
            "http://nwzimg.wezhan.cn/contents/sitefiles2029/10146688/images/21129958.jpg",
          dogName: "哈士奇",
        },
        {
          dogImgUrl:
            "http://nwzimg.wezhan.cn/contents/sitefiles2029/10146688/images/21129958.jpg",
          dogName: "阿拉斯加",
        },
        {
          dogImgUrl:
            "http://nwzimg.wezhan.cn/contents/sitefiles2029/10146688/images/21129958.jpg",
          dogName: "萨摩耶",
        },
      ],
    };
  },
  methods: {
      fn(name){
          this.lovearr.push(name)
      }
  }
};
</script>

<style>
</style>